
using System;
using InfoTech.Utilities.Generic;

namespace InfoTech.LanTranh.MucVu.Bussiness
{
    public partial class SOBITICH
    {
        private GIAODAN _prt_giaodan_nguoidodau;
        public GIAODAN PRT_GIAODAN_NGUOIDODAU
        {
            get
            {
                if (RefreshType == InfoTech.Core.Data.RefreshType.Allway || (RefreshType == InfoTech.Core.Data.RefreshType.OnlyonNull && _prt_giaodan_nguoidodau == default(GIAODAN)))
                    InfoTech.Core.Data.Receiver.TypeObject<GIAODAN>.Select(this, "PRT_GIAODAN_NGUOIDODAU", new[] { new Vector<string, string>("NGUOIDODAUID", "MAGIAODAN"), }, InfoTech.Core.Data.RelationType.OnetoOne);
                return _prt_giaodan_nguoidodau;
            }
            set
            {
                _prt_giaodan_nguoidodau = value;
            }
        }

        public string GetNgayNhan()
        {
            string day = "", month = "", year = "";
            if (NGAYNHAN.HasValue)
                day = NGAYNHAN.Value.ToString("00") + "/";
            if (THANGNHAN.HasValue)
                month = THANGNHAN.Value.ToString("00") + "/";
            if (NAMNHAN.HasValue)
                year = NAMNHAN.Value.ToString("0000");
            return string.Format("{0}{1}{2}", day, month, year);
        }
    }
}
